package cn.aeolia.controller;

import cn.aeolia.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author aeolia
 * @Date 2021/5/28 20:42
 */
@Controller
public class EmployeeController {
    @Autowired
    private EmployeeService employeeService;

    @RequestMapping("/tables")
    public String employeesManagement(){
        return "tables";
    }

    @RequestMapping("/tables_em")
    public ModelAndView employees(ModelAndView modelAndView){
        modelAndView.addObject("employees",employeeService.getAllEmployee());
        modelAndView.setViewName("tables_em");
        return modelAndView;
    }


}
